1. Field
The present invention relates to image coding and decoding, and more particularly, to a method and apparatus for coding a chrominance component of an intra-image using spatial predictive coding and a method and apparatus for decoding the coded chrominance component.
2. Description of the Related Art
When an image or a motion image is compressed, the image is usually divided into a luminance component and a chrominance component, which are coded. The luminance component and the chrominance component have different statistical characteristics. Since human eyes are more sensitive to a change in the luminance component than to a change in the chrominance component, a sampling frequency for the luminance component is usually two or four times higher than that for the chrominance component. Pixel values of the chrominance component have a less variance than pixel values of the luminance component.
In conventional international standard technology for compressing a motion image, a single image is divided into a chrominance component and a luminance component and then coded. The image is coded without referring to another image. The coded image is referred to when images temporally following the coded image are predictively coded using motion estimation and compensation. The image coded without referring to another image is referred to as an intra-image, and the image coded using motion estimation and compensation referring to another image is referred to as an inter-image. The intra-image and the inter-image are lossy compressed through discrete cosine transformation (DCT), quantization, and entropy coding. Here, since temporal prediction is not used for the intra-image, spatial prediction is used for the intra-image to increase compression efficiency.
In motion image compression technology according to International Organization for Standardization/International Electrotechnical Commission (ISO/IEC) Motion Picture Experts Group (MPEG)-4 and International Telecommunication Union-Telecommunication Standardization (ITU-T) H.263+, when a spatial prediction is performed on the intra-image, an 8×8 pixel block is defined, and DCT and quantization are performed on each block. Next, direct current (DC) values and alternating current (AC) values of a current block are predictively coded referring to DC values and AC values of adjacent blocks to increase compression efficiency.
Recently, ISO/IEC MPEG and ITU-T Video Coding Experts Group (VCEG) organized a joint video team (JVT) to develop a new video coding standard. The final recommendation of the JVT committee includes technology for compressing an intra-image using spatial predictive coding. In this technology, a block size and a spatial prediction method used for a luminance component are different from those used for a chrominance component. A block of 4×4 or 16×16 is used for the luminance component. When a 4×4 block is used, 9 prediction methods are used according to a prediction direction. When a 16×16 block is used, 4 prediction methods are used according to a prediction direction.
Similarly to prediction using a 16×16 block for the luminance component, prediction for the chrominance component uses 4 prediction methods in which a block has a size of 8×8. In FIG. 1A, “q” denotes a value of each pixel in a current block of 8×8 to be coded or a value of a pixel in a block adjacent to the current block. A pixel value in the adjacent block is used to predict a pixel value in the current block. Specifically, a DC prediction method, a vertical prediction method, a horizontal prediction method, and a plane prediction method are used. In each prediction method, before pixel values in the current block are being coded, values of the respective pixels in the current block are predicted referring to values of pixels at the edges in adjacent blocks. The edges of the adjacent blocks respectively meet the left and the top of the current block. Next, a differential value between a predicted value, i.e., a prediction value of each pixel in the current block and a corresponding real pixel value in the current block is coded.
The DC prediction method uses an average of pixel values referred to. Referring to FIG. 1B, S0 denotes an average of pixel values q10, q20, q30, and q40. S1 denotes an average of pixel values q50, q60, q70, and q80. S2 denotes an average of pixel values q01, q02, q03, and q04. S3 denotes an average of pixel values q05, q06, q07, and q08. A pixel value in a block A of 4×4 is predicted using the averages S0 and S2. If only one of the averages S0 and S2 can be referred to, prediction is performed using the average S0 or S2 that can be referred to. If neither of the averages S0 and S2 can be referred to, a value of 128 is used for prediction. A pixel value in a block B of 4×4 is predicted using the average S1. If the average S1 cannot be referred to, the average S2 is referred to. If even the average S2 cannot be referred to, a value of 128 is used for prediction. A pixel value in a block C of 4×4 is predicted using the average S3. If the average S3 cannot be referred to, the average S0 is referred to. If even the average S0 cannot be referred to, a value of 128 is used for prediction. A pixel value in a block D of 4×4 is predicted using the averages S1 and S3. If only one of the averages S1 and S3 can be referred to, prediction is performed using the average S1 or S3 that can be referred to. If neither of the averages S1 and S3 can be referred to, a value of 128 is used for prediction.
In performing predictive coding, a differential value “pxy′” obtained by subtracting a prediction value “pred” generated using a pixel value in an adjacent block from a corresponding pixel value “pxy” in a current block to be coded is coded. For example, when all of the averages S0 through S3 can be used, the differential value “pxy′” to be coded using frequency transformation and quantization and the prediction value “pred” depending on a coordinate value of the pixel are defined by Formula (1).pxy′=pxy−pred,pred=(S0+S2)/2, 1≦x,y≦4,pred=S1, 5≦x≦8, 1≦y≦4,pred=S3, 1≦x≦4, 5≦y≦8,pred=(S1+S3)/2, 5≦x,y≦8  (1)
Meanwhile, in the vertical prediction method, predictive coding is performed in a vertical direction using a value of a pixel above a current block. In other words, pixels on the same column have the same prediction value q.sub.x0, and a differential value to be coded is generated using Formula (2).pxy′=pxy−qx0, 1≦x,y≦8  (2)
In the horizontal prediction method, predictive coding is performed in a horizontal direction using a value of a pixel on the left of a current block. In other words, pixels on the same row have the same prediction value q.sub.0y, and a differential value to be coded is generated using Formula (3).pxy′=pxy−q0y, 1≦x,y≦8  (3)
In the plane prediction method, a vertical variation and a horizontal variation are obtained using pixel values referred to, and pixel values in a current block are predicted according to a plane equation using the vertical and horizontal variations and the pixel values referred to. In other words, when a prediction value for a pixel value “pxy” in a current block is denoted by “predxy”, the prediction value “predxy” and a differential value “pxy′” are generated using Formula (4).
                                                        p              xy                        ′                    =                                    p              xy                        -                                          pred                xy                            ′                                      ,                                  ⁢                              pred            xy                    =                                    (                              a                +                                  b                  ×                                      (                                          x                      -                      3                                        )                                                  +                                  c                  ×                                      (                                          y                      -                      3                                        )                                                              )                        /            32                          ,                                  ⁢                  a          =                      16            ×                          (                                                q                  80                                +                                  q                  08                                            )                                      ,                                  ⁢                  b          =                                    (                              17                ×                                  ⅆ                                                                          ⁢                  H                                            )                        /            32                          ,                                  ⁢                  c          =                                    (                              17                ×                                  ⅆ                                                                          ⁢                  V                                            )                        /            32                          ,                                  ⁢                              ⅆ            H                    =                                                    ∑                                                      x                    ′                                    =                  1                                4                            ⁢                                                          ⁢                                                x                  ′                                ×                                  (                                                            q                                                                        4                          +                                                      x                            ′                                                                          ,                        0                                                              -                                          q                                                                        4                          -                                                      x                            ′                                                                          ,                        0                                                                              )                                ⁢                                                                  ⁢                                  ⅆ                  V                                                      =                                          ∑                                                      y                    ′                                    =                  1                                4                            ⁢                                                          ⁢                                                y                  ′                                ×                                  (                                                            q                                              0                        ,                                                  4                          +                                                      y                            ′                                                                                                                -                                          q                                              0                        ,                                                  4                          -                                                      y                            ′                                                                                                                                )                                                                                        (        4        )            
Here, dH and dV denote the horizontal variation and the vertical variation, respectively.
The plane prediction method is disadvantageous in that a large amount of calculation is required because the vertical and horizontal variations need to be calculated and a prediction value of each pixel needs to be calculated using the plane equation.
In order to indicate which of the four prediction methods has been used during coding, entropy coding is performed using a variable-length code so that compensation during decoding is performed using the prediction method used during coding.